package com.ruoyi.bi.domain.model;

import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.bi.domain.common.BaseEntity;
import com.ruoyi.bi.util.RSBIUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@Data
@TableName("bi_cube_meta")
public class Cube extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@TableId(type = IdType.AUTO)
	private Integer cubeId;
	private String cubeName;
	private String cubeDesc;
	private String dsetId;
	/** 数据集名称 */
	private String dsetName;
	/** 数据源ID */
	private Long dsId;
	/** 主表 */
	@TableField("primary_table")
	private String priTable;

	@TableField(exist = false)
	private List<Dimension> dims;

	@TableField(exist = false)
	private List<Measure> kpis;

	/** 需要删除的对象, 包含 id, type */
	@TableField(exist = false)
	private List<Map<String, Object>> delObj;

	 @Override
	public void validate() {
		 this.cubeName = RSBIUtils.htmlEscape(this.cubeName);
	 }
}
